package com.itheima02;

public class Test04 {
    public static void main(String[] args) {
        Student s = new Student();
        s.setName("张三");
        try {
            s.setAge(40);
        } catch (AgeException e) {
            //e.printStackTrace();
            System.out.println("年龄异常!");
        }

        try {
            s.setSex("男");
        } catch (SexException e) {
            //e.printStackTrace();
            System.out.println("性别异常!");
        }
        System.out.println(s);
    }
}
